package com.lq.ecoldchain.ui.main.orderlist.order

import android.support.v4.app.Fragment
import com.lq.ecoldchain.R
import com.lq.ecoldchain.base.view.BaseFragment
import com.lq.ecoldchain.common.FragmentViewPagerAdapter
import com.lq.ecoldchain.databinding.FragmentOrderNewBinding
import com.lq.ecoldchain.ui.main.orderlist.order.list.MineOrderListFragment
import kotlinx.android.synthetic.main.fragment_order_new.*
import org.kodein.di.Kodein
import org.kodein.di.generic.instance

/*
*2019/1/6 0006  17:46
*function by lq
*/
class MineOrderFragment:BaseFragment<FragmentOrderNewBinding>(){
    override val layoutId = R.layout.fragment_order_new
    override val viewDelegate:MineOrderDelegate by instance()

    override fun initView() {
        binding.delegate = viewDelegate
        orderTabLayout.setupWithViewPager(orderViewPager)
        val fragments = ArrayList<Fragment>()
        fragments.add(MineOrderListFragment.newInstance("0"))//我的接单
        fragments.add(MineOrderListFragment.newInstance("1"))//我的接单
        fragments.add(MineOrderListFragment.newInstance("2"))//我的接单
        val titles :Array<String> = arrayOf("全部","进行中","已完成")
        orderViewPager.adapter = FragmentViewPagerAdapter(childFragmentManager,fragments,titles)
    }

    override val kodein = Kodein.lazy {
        extend(parentKodein)
        import(mineOrderKodeinModule)
    }

}